import { updataUserProfile } from '@/api/user'
import { Toast } from 'vant'
export const confirm = async (key, value, isshow) => {
  Toast.loading({
    message: '保存中',
    forbidclick: true
  })
  try {
    await updataUserProfile({ [key]: value })
    Toast.success("保存成功")

    isshow = false
  } catch (error) {
    if (error && error.response.status === 409) {
      Toast.fail("修改失败")
    }
  }
}